﻿using CSharpTestProject.AdminFormFolder;
using CSharpTestProject.Utils;
using System;
using System.Windows.Forms;

namespace CSharpTestProject
{
    public partial class AdminForm : Form
    {
        private _Sql sql;
        public AdminForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            AddStudentForm addStudentForm = new AddStudentForm();
            addStudentForm.sql = sql;
            addStudentForm.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DeleteStudentForm deleteStudentForm = new DeleteStudentForm();
            deleteStudentForm.sql = sql;
            deleteStudentForm.ShowDialog();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            ModifyStudentForm modifyStudentForm = new ModifyStudentForm();
            modifyStudentForm.sql = sql;
            modifyStudentForm.ShowDialog();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            FindStudentForm findStudentForm = new FindStudentForm();
            findStudentForm.sql = sql;
            findStudentForm.ShowDialog();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            AddTeacherForm addTeacherForm = new AddTeacherForm();
            addTeacherForm.sql = sql;
            addTeacherForm.ShowDialog();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            DeleteTeacherForm deleteTeacherForm= new DeleteTeacherForm();
            deleteTeacherForm.sql = sql;
            deleteTeacherForm.ShowDialog();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            ModifyTeacherForm modifyTeacherForm = new ModifyTeacherForm();
            modifyTeacherForm.sql = sql;
            modifyTeacherForm.ShowDialog();
        }

        private void button8_Click(object sender, EventArgs e)
        {
            FindTeacherForm findTeacherForm = new FindTeacherForm();
            findTeacherForm.sql = sql;
            findTeacherForm.ShowDialog();
        }

        private void AdminForm_Load(object sender, EventArgs e)
        {
            sql = new _Sql();
            sql.SqlConnect();
        }
    }
}
